package hw2.cs236369.filtering;

import hw2.cs236369.interfaces.IAuthor;
import hw2.cs236369.interfaces.IDBFactory;
import hw2.cs236369.interfaces.IDBLP;
import hw2.cs236369.interfaces.IDBLPInfo;
import hw2.cs236369.parsing.DBFactory;

public class Main {

	private final static IDBFactory factory = new DBFactory();

	public static void main(String[] args) {
//		if (args.length == 0 ) {
//			// for debug
//			args = new String[] { "C:/dblp.xml", "Joseph Gil"};
//		}
		String dblpPath = args[0];
		final String regExp = args[1];
		IDBLP dblp = factory.produce(dblpPath, regExp);
		Filter filter = new Filter(dblp);

		for (IAuthor author: filter.getAuthors()) {
			IDBLPInfo info = filter.getInfo(author);
			System.out.println(info.toPrintableString());
		}
	}

}
